<extend name="Public/layout"/>

<block name="body">
    <div class="container">
        <duv class="row">
            <div class="login col-xs-12 col-md-6">
                <div class="title">
                    <h2>{$meta_title}</h2>
                </div>
                <form action="__SELF__" method="post" class="form">
                    <div class="form-group">
                        <label class="item-label">用户名<span class="check-tips"></span></label>
                        <div class="controls">
                            <input type="text" class="form-control" name="username" value="{$info.username|default=''}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="item-label">邮箱<span class="check-tips"></span></label>
                        <div class="controls">
                            <input type="text" class="form-control" name="email" value="{$info.email|default=''}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="item-label">手机号码<span class="check-tips"></span></label>
                        <div class="controls">
                            <input type="text" class="form-control" name="mobile" value="{$info.mobile|default=''}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="item-label">密码<span class="check-tips"></span></label>
                        <div class="controls">
                            <input type="text" class="form-control" name="password" value="">
                        </div>
                    </div>
                    <div class="form-group">
                        <input type="hidden" name="id" value="{$info.id|default=''}">
                        <button class="btn ajax-post"  type="submit" target-form="form">注 册</button>
                        <button class="btn" onclick="javascript:history.back(-1);return false;">返 回</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</block>

<block name="style">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/huploadify/huploadify.css">
</block>
<block name="script">
    <script type="text/javascript" src="__PUBLIC__/huploadify/huploadify.js" charset="utf-8"></script>
    <script type="text/javascript">
        $('#upload').Huploadify({
            fileTypeExts:'*.jpg;*.png;*.gif',//允许上传的文件类型，格式'*.jpg;*.doc'
            uploader:'{:U("Admin/Upload/upload")}',//文件提交的地址
            auto:true,//是否开启自动上传
            multi:false,//是否允许选择多个文件
            formData:{dir:'image'},//发送给服务端的参数，格式：{key1:value1,key2:value2}
            buttonText:'上 传 头 像',//上传按钮上的文字
            onUploadComplete:function(file, data){
                var data = $.parseJSON(data);
                $('#preview img').attr('src', data.url);
                $('#preview input').attr('value', data.id);
            },
            onUploadError:function(){
                console.log('开始失败');
            },
            onInit:function(){
                console.log('初始化');
            },
            onCancel:function(file){
                console.log(file);
            }
        });
    </script>
</block>
